﻿<?php
//echo $_GET['os'];//输出“2”
//echo $_GET['src'];//输出“真好”

$id = $_GET['info'];

$s3 = "0";

//$db = new SQLite3('/home/y185837/public_html/chat/download.s3db');

try {
	//$db = new PDO( "download.s3db" );
	//$db = new PDO( "sqlite:/home/y185837/public_html/chat/download.s3db" );
	$db = new PDO("sqlite:D:\Desktop\download.s3db");
	$sql = 'SELECT des ,urls FROM content where title = "' . $id . '" ';

	$db -> beginTransaction();
	$sth = $db -> prepare($sql);
	$sth -> execute();
	//获取结果
	$result = $sth -> fetchAll();
	if ($result) {
		foreach ($result as $k => $v) {
			$s3 = $v['des'];
			$s4 = $v['urls'];
			if ($s4) {
				$s3 = $s3 . '<a href="' . $s4 . '">：网址链接</a>';
			}
		}
	} else {
		$s3 = '0';
	}
	//print_r($result);
	$dsn = null;
} catch (PDOException $e) {
	//echo  $s3 ;//'Connection failed: ' . $e->getMessage();
	$dsn = null;
}

echo $s3;

/*
 //echo $_GET['src'];//输出“真好”

 $id = $_GET['info'];

 $s3="0";

 $db = new SQLite3('download.s3db');
 //$sql ='SELECT des as ct FROM content where title like "%'.$id.'%" ';
 $sql ='SELECT des as ct FROM content where title = "'.$id.'" ';
 //echo $sql;
 $results = $db->query($sql);

 while ($row = $results->fetchArray()) {
 //var_dump($row);
 $s3=$row["ct"];
 //print "<BR>";
 }

 $db->close();

 echo $s3;

 */
?>